﻿/*
 * EmeCoder v1.2.1.168
 * 作者：Administrator/CAI-PC
 * 时间：2013-10-19 20:24:57
 * 版权：版权所有 (C) Eme Development Team 2013
*/

﻿using System;
using System.ComponentModel;
using HmFramework.Data;
using HmFramework.Data.Configuration;
using HmFramework.Data.DataAccessLayer;

namespace CuteSprite.Eme.Data.Settlement
{
	/// <summary>计费价格方案</summary>
	[Serializable]
	[DataObject]
	[Description("计费价格方案")]
	[BindIndex("IX_Price_BillingSolutionID", false, "BillingSolutionID")]
	[BindIndex("PK__PriceSolutionID__84F386510D93572D", true, "ID")]
	[BindRelation("BillingSolutionID", false, "BillingSolution", "ID")]
	[BindTable("PriceSolution", Description = "计费价格方案", ConnName = "EmeSettlement", DbType = DatabaseType.SqlServer)]
	public abstract partial class PriceSolution<TEntity> : IPriceSolution
	{
		#region 属性

		private Int32 _ID;

		/// <summary>主键</summary>
		[DisplayName("主键")]
		[Description("主键")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "ID", "主键", null, "int", 10, 0, false)]
		public virtual Int32 ID
		{
			get { return _ID; }
			set { if (OnPropertyChanging(__.ID, value)) { _ID = value; OnPropertyChanged(__.ID); } }
		}

		private Int32 _BillingSolutionID;

		/// <summary>计费方案</summary>
		[DisplayName("计费方案")]
		[Description("计费方案")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(2, "BillingSolutionID", "计费方案", null, "int", 10, 0, false)]
		public virtual Int32 BillingSolutionID
		{
			get { return _BillingSolutionID; }
			set { if (OnPropertyChanging(__.BillingSolutionID, value)) { _BillingSolutionID = value; OnPropertyChanged(__.BillingSolutionID); } }
		}

		private Boolean _IsMultiPrice;

		/// <summary>区分首重续重</summary>
		[DisplayName("区分首重续重")]
		[Description("区分首重续重")]
		[DataObjectField(false, false, false, 1)]
		[BindColumn(3, "IsMultiPrice", "区分首重续重", null, "bit", 0, 0, false)]
		public virtual Boolean IsMultiPrice
		{
			get { return _IsMultiPrice; }
			set { if (OnPropertyChanging(__.IsMultiPrice, value)) { _IsMultiPrice = value; OnPropertyChanged(__.IsMultiPrice); } }
		}

		private Decimal _WeightBasedBilling;

		/// <summary>计费重量基数</summary>
		[DisplayName("计费重量基数")]
		[Description("计费重量基数")]
		[DataObjectField(false, false, false, 19)]
		[BindColumn(4, "WeightBasedBilling", "计费重量基数", null, "money", 19, 4, false)]
		public virtual Decimal WeightBasedBilling
		{
			get { return _WeightBasedBilling; }
			set { if (OnPropertyChanging(__.WeightBasedBilling, value)) { _WeightBasedBilling = value; OnPropertyChanged(__.WeightBasedBilling); } }
		}

		private Int16 _WeightStart;

		/// <summary>重量分段起始值</summary>
		[DisplayName("重量分段起始值")]
		[Description("重量分段起始值")]
		[DataObjectField(false, false, true, 5)]
		[BindColumn(6, "WeightStart", "重量分段起始值", null, "smallint", 5, 0, false)]
		public virtual Int16 WeightStart
		{
			get { return _WeightStart; }
			set { if (OnPropertyChanging(__.WeightStart, value)) { _WeightStart = value; OnPropertyChanged(__.WeightStart); } }
		}

		private Int16 _WeightEnd;

		/// <summary>重量分段结束值</summary>
		[DisplayName("重量分段结束值")]
		[Description("重量分段结束值")]
		[DataObjectField(false, false, true, 5)]
		[BindColumn(7, "WeightEnd", "重量分段结束值", null, "smallint", 5, 0, false)]
		public virtual Int16 WeightEnd
		{
			get { return _WeightEnd; }
			set { if (OnPropertyChanging(__.WeightEnd, value)) { _WeightEnd = value; OnPropertyChanged(__.WeightEnd); } }
		}

		private Decimal _PrimaryPrice;

		/// <summary>首重计费</summary>
		[DisplayName("首重计费")]
		[Description("首重计费")]
		[DataObjectField(false, false, false, 19)]
		[BindColumn(8, "PrimaryPrice", "首重计费", null, "money", 19, 4, false)]
		public virtual Decimal PrimaryPrice
		{
			get { return _PrimaryPrice; }
			set { if (OnPropertyChanging(__.PrimaryPrice, value)) { _PrimaryPrice = value; OnPropertyChanged(__.PrimaryPrice); } }
		}

		private Decimal _ExtraPrice;

		/// <summary>续重计费</summary>
		[DisplayName("续重计费")]
		[Description("续重计费")]
		[DataObjectField(false, false, true, 19)]
		[BindColumn(9, "ExtraPrice", "续重计费", null, "money", 19, 4, false)]
		public virtual Decimal ExtraPrice
		{
			get { return _ExtraPrice; }
			set { if (OnPropertyChanging(__.ExtraPrice, value)) { _ExtraPrice = value; OnPropertyChanged(__.ExtraPrice); } }
		}

		private DateTime _ModifiedOn;

		/// <summary>修改时间</summary>
		[DisplayName("修改时间")]
		[Description("修改时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(10, "ModifiedOn", "修改时间", null, "datetime", 3, 0, false)]
		public virtual DateTime ModifiedOn
		{
			get { return _ModifiedOn; }
			set { if (OnPropertyChanging(__.ModifiedOn, value)) { _ModifiedOn = value; OnPropertyChanged(__.ModifiedOn); } }
		}

		private Int32 _ModifiedUserID;

		/// <summary>修改用户ID</summary>
		[DisplayName("修改用户ID")]
		[Description("修改用户ID")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(11, "ModifiedUserID", "修改用户ID", null, "int", 10, 0, false)]
		public virtual Int32 ModifiedUserID
		{
			get { return _ModifiedUserID; }
			set { if (OnPropertyChanging(__.ModifiedUserID, value)) { _ModifiedUserID = value; OnPropertyChanged(__.ModifiedUserID); } }
		}

		private String _ModifiedBy;

		/// <summary>修改用户</summary>
		[DisplayName("修改用户")]
		[Description("修改用户")]
		[DataObjectField(false, false, false, 50)]
		[BindColumn(12, "ModifiedBy", "修改用户", null, "nvarchar(50)", 0, 0, true)]
		public virtual String ModifiedBy
		{
			get { return _ModifiedBy; }
			set { if (OnPropertyChanging(__.ModifiedBy, value)) { _ModifiedBy = value; OnPropertyChanged(__.ModifiedBy); } }
		}

		private DateTime _CreateOn;

		/// <summary>创建时间</summary>
		[DisplayName("创建时间")]
		[Description("创建时间")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(13, "CreateOn", "创建时间", null, "datetime", 3, 0, false)]
		public virtual DateTime CreateOn
		{
			get { return _CreateOn; }
			set { if (OnPropertyChanging(__.CreateOn, value)) { _CreateOn = value; OnPropertyChanged(__.CreateOn); } }
		}

		private Int32 _CreateUserID;

		/// <summary>创建用户ID</summary>
		[DisplayName("创建用户ID")]
		[Description("创建用户ID")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(14, "CreateUserID", "创建用户ID", null, "int", 10, 0, false)]
		public virtual Int32 CreateUserID
		{
			get { return _CreateUserID; }
			set { if (OnPropertyChanging(__.CreateUserID, value)) { _CreateUserID = value; OnPropertyChanged(__.CreateUserID); } }
		}

		private String _CreateBy;

		/// <summary>创建用户</summary>
		[DisplayName("创建用户")]
		[Description("创建用户")]
		[DataObjectField(false, false, false, 50)]
		[BindColumn(15, "CreateBy", "创建用户", null, "nvarchar(50)", 0, 0, true)]
		public virtual String CreateBy
		{
			get { return _CreateBy; }
			set { if (OnPropertyChanging(__.CreateBy, value)) { _CreateBy = value; OnPropertyChanged(__.CreateBy); } }
		}

		#endregion

		#region 获取/设置 字段值

		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case __.ID: return _ID;
					case __.BillingSolutionID: return _BillingSolutionID;
					case __.IsMultiPrice: return _IsMultiPrice;
					case __.WeightBasedBilling: return _WeightBasedBilling;
					case __.WeightStart: return _WeightStart;
					case __.WeightEnd: return _WeightEnd;
					case __.PrimaryPrice: return _PrimaryPrice;
					case __.ExtraPrice: return _ExtraPrice;
					case __.ModifiedOn: return _ModifiedOn;
					case __.ModifiedUserID: return _ModifiedUserID;
					case __.ModifiedBy: return _ModifiedBy;
					case __.CreateOn: return _CreateOn;
					case __.CreateUserID: return _CreateUserID;
					case __.CreateBy: return _CreateBy;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case __.ID: _ID = Convert.ToInt32(value); break;
					case __.BillingSolutionID: _BillingSolutionID = Convert.ToInt32(value); break;
					case __.IsMultiPrice: _IsMultiPrice = Convert.ToBoolean(value); break;
					case __.WeightBasedBilling: _WeightBasedBilling = Convert.ToDecimal(value); break;
					case __.WeightStart: _WeightStart = Convert.ToInt16(value); break;
					case __.WeightEnd: _WeightEnd = Convert.ToInt16(value); break;
					case __.PrimaryPrice: _PrimaryPrice = Convert.ToDecimal(value); break;
					case __.ExtraPrice: _ExtraPrice = Convert.ToDecimal(value); break;
					case __.ModifiedOn: _ModifiedOn = Convert.ToDateTime(value); break;
					case __.ModifiedUserID: _ModifiedUserID = Convert.ToInt32(value); break;
					case __.ModifiedBy: _ModifiedBy = Convert.ToString(value); break;
					case __.CreateOn: _CreateOn = Convert.ToDateTime(value); break;
					case __.CreateUserID: _CreateUserID = Convert.ToInt32(value); break;
					case __.CreateBy: _CreateBy = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}

		#endregion

		#region 字段名

		/// <summary>取得计费价格方案字段信息的快捷方式</summary>
		public partial class _
		{
			///<summary>主键</summary>
			public static readonly Field ID = FindByName(__.ID);

			///<summary>计费方案</summary>
			public static readonly Field BillingSolutionID = FindByName(__.BillingSolutionID);

			///<summary>区分首重续重</summary>
			public static readonly Field IsMultiPrice = FindByName(__.IsMultiPrice);

			///<summary>计费重量基数</summary>
			public static readonly Field WeightBasedBilling = FindByName(__.WeightBasedBilling);

			///<summary>重量分段起始值</summary>
			public static readonly Field WeightStart = FindByName(__.WeightStart);

			///<summary>重量分段结束值</summary>
			public static readonly Field WeightEnd = FindByName(__.WeightEnd);

			///<summary>首重计费</summary>
			public static readonly Field PrimaryPrice = FindByName(__.PrimaryPrice);

			///<summary>续重计费</summary>
			public static readonly Field ExtraPrice = FindByName(__.ExtraPrice);

			///<summary>修改时间</summary>
			public static readonly Field ModifiedOn = FindByName(__.ModifiedOn);

			///<summary>修改用户ID</summary>
			public static readonly Field ModifiedUserID = FindByName(__.ModifiedUserID);

			///<summary>修改用户</summary>
			public static readonly Field ModifiedBy = FindByName(__.ModifiedBy);

			///<summary>创建时间</summary>
			public static readonly Field CreateOn = FindByName(__.CreateOn);

			///<summary>创建用户ID</summary>
			public static readonly Field CreateUserID = FindByName(__.CreateUserID);

			///<summary>创建用户</summary>
			public static readonly Field CreateBy = FindByName(__.CreateBy);

			private static Field FindByName(String name)
			{
				return Meta.Table.FindByName(name);
			}
		}

		/// <summary>取得计费价格方案字段名称的快捷方式</summary>
		public partial class __
		{
			///<summary>主键</summary>
			public const String ID = "ID";

			///<summary>计费方案</summary>
			public const String BillingSolutionID = "BillingSolutionID";

			///<summary>区分首重续重</summary>
			public const String IsMultiPrice = "IsMultiPrice";

			///<summary>计费重量基数</summary>
			public const String WeightBasedBilling = "WeightBasedBilling";

			///<summary>重量分段起始值</summary>
			public const String WeightStart = "WeightStart";

			///<summary>重量分段结束值</summary>
			public const String WeightEnd = "WeightEnd";

			///<summary>首重计费</summary>
			public const String PrimaryPrice = "PrimaryPrice";

			///<summary>续重计费</summary>
			public const String ExtraPrice = "ExtraPrice";

			///<summary>修改时间</summary>
			public const String ModifiedOn = "ModifiedOn";

			///<summary>修改用户ID</summary>
			public const String ModifiedUserID = "ModifiedUserID";

			///<summary>修改用户</summary>
			public const String ModifiedBy = "ModifiedBy";

			///<summary>创建时间</summary>
			public const String CreateOn = "CreateOn";

			///<summary>创建用户ID</summary>
			public const String CreateUserID = "CreateUserID";

			///<summary>创建用户</summary>
			public const String CreateBy = "CreateBy";
		}

		#endregion
	}

	/// <summary>计费价格方案接口</summary>
	public partial interface IPriceSolution
	{
		#region 属性

		/// <summary>主键</summary>
		Int32 ID { get; set; }

		/// <summary>计费方案</summary>
		Int32 BillingSolutionID { get; set; }

		/// <summary>区分首重续重</summary>
		Boolean IsMultiPrice { get; set; }

		/// <summary>计费重量基数</summary>
		Decimal WeightBasedBilling { get; set; }

		/// <summary>重量分段起始值</summary>
		Int16 WeightStart { get; set; }

		/// <summary>重量分段结束值</summary>
		Int16 WeightEnd { get; set; }

		/// <summary>首重计费</summary>
		Decimal PrimaryPrice { get; set; }

		/// <summary>续重计费</summary>
		Decimal ExtraPrice { get; set; }

		/// <summary>修改时间</summary>
		DateTime ModifiedOn { get; set; }

		/// <summary>修改用户ID</summary>
		Int32 ModifiedUserID { get; set; }

		/// <summary>修改用户</summary>
		String ModifiedBy { get; set; }

		/// <summary>创建时间</summary>
		DateTime CreateOn { get; set; }

		/// <summary>创建用户ID</summary>
		Int32 CreateUserID { get; set; }

		/// <summary>创建用户</summary>
		String CreateBy { get; set; }

		#endregion

		#region 获取/设置 字段值

		/// <summary>获取/设置 字段值。</summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		Object this[String name] { get; set; }

		#endregion
	}
}